package com.logos.io;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;

public class charSet {

    public static void main(String[] args) throws UnsupportedEncodingException {
        // 编码和解码
        String s = "你好";
        byte[] bytes1 = s.getBytes();
        System.out.println(Arrays.toString(bytes1));
        byte[] bytes2 = s.getBytes("GBK");
        System.out.println(Arrays.toString(bytes2));
        String s1 = new String(bytes1);
        System.out.println(s1);
        String s2 = new String(bytes2,"GBK");
        System.out.println(s2);
    }
}
